<template>
    <van-skeleton v-if="status" title :row="3" />
    <div v-else>
        <form action="/">
            <van-search v-model="value" show-action placeholder="请输入搜索关键词" @search="onSearch"  />
        </form>



    </div>
</template>

<script setup>
import { ref, watch } from 'vue';
import { qsearchApi } from '@/api/api';
import { useRouter } from 'vue-router';
let router = useRouter()
let qsearch = ref([])
import _ from 'lodash'
let status=ref(true)
setTimeout(()=>{
    status.value=false
},2000)
watch(qsearch,
    _.debounce(val => {
        console.log('防抖', val);
        qsearchApi(val).then(res => {
            console.log('搜索', res);
            qsearch.value = res.data.message
        })
    })
)
const onSearch = () => {
    router.push('/home/cla')
}
</script>

<style lang="scss" scoped></style>